class Solution(object):
    def countDigits(self, num):
        """
        :type num: int
        :rtype: int
        """
        val = str(num)
        val = [int(i) for i in val]
        result = [a for a in val if num % a == 0]
        return len(result)
    
if __name__ == '__main__':
    num = 121
    result = Solution().countDigits(num)
    print(result)
        